<!DOCTYPE html><html>

<head>
<meta charset="utf-8">
<title></title>
<style>
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}
html{line-height:1}
ol,ul{list-style:none}
table{border-collapse:collapse;border-spacing:0;
  margin-top: 0;
  margin-bottom: 0.8em;
}
caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}
q,blockquote{quotes:none}
q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}
a img{border:none}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block}
a{color:#1863a1}
a:visited{color:#751590}
a:focus{color:#0181eb}
a:hover{color:#0181eb}
a:active{color:#01579f}
aside.sidebar a{color:#222}
aside.sidebar a:focus{color:#0181eb}
aside.sidebar a:hover{color:#0181eb}
aside.sidebar a:active{color:#01579f}
a{-webkit-transition:color 0.3s;-moz-transition:color 0.3s;-o-transition:color 0.3s;transition:color 0.3s}

body,h1,h2,h3,h4,h5,h6,footer{font-family:"PT Sans","Helvetica Neue","Optima","Hiragino Sans GB",sans-serif}
body{line-height:1.5em;color:#222
	-webkit-text-size-adjust:none;  min-width: 200px;
  max-width: 760px;
  margin: 0 auto; padding: 1em;}

pre,code,tt,p code,li code{font-family:Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace}

h1{font-size:2.2em;line-height:1.2em}

h1,h2,h3,h4,h5,h6{text-rendering:optimizelegibility;margin-bottom:1em;font-weight:bold}
h2,section h1{font-size:1.5em}
h3,section h2,section section h1{font-size:1.3em}
h4,section h3,section section h2,section section section h1{font-size:1em}
h5,section h4,section section h3{font-size:.9em}
h6,section h5,section section h4,section section section h3{font-size:.8em}
.markdown-body{padding: 0px 4px;}
.markdown-body h1{position:relative;padding-top:1em;padding-bottom:0.2em;margin-bottom:1em;background:url('') bottom left repeat-x}
.markdown-body  h1 a{text-decoration:none}
.markdown-body  h1 a:hover{text-decoration:underline}

.markdown-body h2{padding-top:0.8em;padding-bottom:0.2em;background:url('') bottom left repeat-x}
.markdown-body h2:first-child,.markdown-body header+h2{padding-top:0}
.markdown-body h2:first-child,.markdown-body header+h2{background:none}



p,.markdown-body blockquote,ul,ol{margin-bottom:0.8em; margin-top:0.8em;}
ul{list-style-type:disc}
ul ul{list-style-type:circle;margin-bottom:0px}
ul ul ul{list-style-type:square;margin-bottom:0px}
ol{list-style-type:decimal}
ol ol{list-style-type:lower-alpha;margin-bottom:0px}
ol ol ol{list-style-type:lower-roman;margin-bottom:0px}
ul,ul ul,ul ol,ol,ol ul,ol ol{margin-left:1.3em}
ul ul,ul ol,ol ul,ol ol{margin-bottom:0em}
strong{font-weight:bold}
em{font-style:italic}
sup,sub{font-size:0.75em;position:relative;display:inline-block;padding:0 .2em;line-height:.8em}
sup{top:-.5em}
sub{bottom:-.5em}
a[rev='footnote']{font-size:.75em;padding:0 .3em;line-height:1}
q{font-style:italic}
q:before{content:"\201C"}
q:after{content:"\201D"}
em,dfn{font-style:italic}
strong,dfn{font-weight:bold}
del,s{text-decoration:line-through}
abbr,acronym{border-bottom:1px dotted;cursor:help}
small{font-size:.8em}
big{font-size:1.2em}

.markdown-body hr {
  height: 0;
  margin: 15px 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ddd;
}

.markdown-body hr:before {
  display: table;
  content: "";
}

.markdown-body hr:after {
  display: table;
  clear: both;
  content: "";
}


.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  word-break: normal;
  word-break: keep-all;
}

.markdown-body table th {
  font-weight: bold;
}

.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid #ddd;
}

.markdown-body table tr {
  background-color: #fff;
  border-top: 1px solid #ccc;
}

.markdown-body table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

.markdown-body blockquote{font-style:italic;position:relative;font-size:1.2em;line-height:1.5em;padding-left:1em;border-left:4px solid rgba(170,170,170,0.5)}
.markdown-body blockquote cite{font-style:italic}
.markdown-body blockquote cite a{color:#aaa !important;word-wrap:break-word}
.markdown-body blockquote cite:before{content:'\2014';padding-right:.3em;padding-left:.3em;color:#aaa}

.markdown-body a{white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word}

body>header{font-size:1em;padding-top:1.5em;padding-bottom:1.5em}
.markdown-body{overflow:hidden}
.markdown-body>div,.markdown-body>article{width:100%}
aside.sidebar{float:none;padding:0 18px 1px;background-color:#f7f7f7;border-top:1px solid #e0e0e0}
.flex-content,article img,article video,article .flash-video,aside.sidebar img{max-width:100%;height:auto}
.basic-alignment.left,article img.left,article video.left,article .left.flash-video,aside.sidebar img.left{float:left;margin-right:1.5em}
.basic-alignment.right,article img.right,article video.right,article .right.flash-video,aside.sidebar img.right{float:right;margin-left:1.5em}
.basic-alignment.center,article img.center,article video.center,article .center.flash-video,aside.sidebar img.center{display:block;margin:0 auto 1.5em}
.basic-alignment.left,article img.left,article video.left,article .left.flash-video,aside.sidebar img.left,.basic-alignment.right,article img.right,article video.right,article .right.flash-video,aside.sidebar img.right{margin-bottom:.8em}
.toggle-sidebar,.no-sidebar .toggle-sidebar{display:none}


.markdown-body img,.markdown-body video,.markdown-body .flash-video{ -webkit-border-radius:0.3em;-moz-border-radius:0.3em;-ms-border-radius:0.3em;-o-border-radius:0.3em;border-radius:0.3em;-webkit-box-shadow:rgba(0,0,0,0.15) 0 1px 4px;-moz-box-shadow:rgba(0,0,0,0.15) 0 1px 4px;box-shadow:rgba(0,0,0,0.15) 0 1px 4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:#fff 0.5em solid;}

.markdown-body img,.markdown-body video{max-width: 100%;}
.markdown-body video,.markdown-body .flash-video{margin:0 auto 1.5em}
.markdown-body video{display:block;width:100%}
.markdown-body .flash-video>div{position:relative;display:block;padding-bottom:56.25%;padding-top:1px;height:0;overflow:hidden}
.markdown-body .flash-video>div iframe,.markdown-body .flash-video>div object,.markdown-body .flash-video>div embed{position:absolute;top:0;left:0;width:100%;height:100%}
.markdown-body>footer{padding-bottom:2.5em;margin-top:2em}
.markdown-body>footer p.meta{margin-bottom:.8em;font-size:.85em;clear:both;overflow:hidden}


body,pre{ background:#fdf6e3 url('') top left;}
body{ background-color: #f8f8f8;}
pre{-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;border:1px solid #e7dec3;line-height:1.45em;font-size:13px;margin-bottom:2.1em;padding:.8em 1em;color:#586e75;overflow:auto}
.markdown-body code{background: none;}
h3.filename+pre{-moz-border-radius-topleft:0px;-webkit-border-top-left-radius:0px;border-top-left-radius:0px;-moz-border-radius-topright:0px;-webkit-border-top-right-radius:0px;border-top-right-radius:0px}
p code,li code{display:inline-block;white-space:no-wrap;background:#fff;font-size:.8em;line-height:1.5em;color:#555;border:1px solid #ddd;-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;padding:0 .3em;margin:-1px 0}
p pre code,li pre code{font-size:1em !important;background:none;border:none}

/*

Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>

*/

.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  background: #fdf6e3;
  color: #657b83;
  -webkit-text-size-adjust: none;
}

.hljs-comment,
.diff .hljs-header,
.hljs-doctype,
.hljs-pi,
.lisp .hljs-string {
  color: #93a1a1;
}

/* Solarized Green */
.hljs-keyword,
.hljs-winutils,
.method,
.hljs-addition,
.css .hljs-tag,
.hljs-request,
.hljs-status,
.nginx .hljs-title {
  color: #859900;
}

/* Solarized Cyan */
.hljs-number,
.hljs-command,
.hljs-string,
.hljs-tag .hljs-value,
.hljs-rule .hljs-value,
.hljs-doctag,
.tex .hljs-formula,
.hljs-regexp,
.hljs-hexcolor,
.hljs-link_url {
  color: #2aa198;
}

/* Solarized Blue */
.hljs-title,
.hljs-localvars,
.hljs-chunk,
.hljs-decorator,
.hljs-built_in,
.hljs-identifier,
.vhdl .hljs-literal,
.hljs-id,
.css .hljs-function,
.hljs-name {
  color: #268bd2;
}

/* Solarized Yellow */
.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.smalltalk .hljs-number,
.hljs-constant,
.hljs-class .hljs-title,
.hljs-parent,
.hljs-type,
.hljs-link_reference {
  color: #b58900;
}

/* Solarized Orange */
.hljs-preprocessor,
.hljs-preprocessor .hljs-keyword,
.hljs-pragma,
.hljs-shebang,
.hljs-symbol,
.hljs-symbol .hljs-string,
.diff .hljs-change,
.hljs-special,
.hljs-attr_selector,
.hljs-subst,
.hljs-cdata,
.css .hljs-pseudo,
.hljs-header {
  color: #cb4b16;
}

/* Solarized Red */
.hljs-deletion,
.hljs-important {
  color: #dc322f;
}

/* Solarized Violet */
.hljs-link_label {
  color: #6c71c4;
}

.tex .hljs-formula {
  background: #eee8d5;
}


</style>

<style> @media print{ .hljs{overflow: visible; word-wrap: break-word !important;} }</style></head><body><div class="markdown-body">
<p>iOS文档组件</p>

<ul>
<li>
<a href="#toc_0"><font color=#0099ff size=6 face="黑体">白板与文档组件</font></a>
<ul>
<li>
<a href="#toc_1"><font color=#0099ff size=5 face="黑体">一、文档组件基础功能使用流程</font></a>
<ul>
<li>
<a href="#toc_2">1.1 Base库对象的创建</a>
</li>
<li>
<a href="#toc_3">1.2 文档组件初始化、设置事件监听</a>
</li>
<li>
<a href="#toc_4">1.3 建立文档库与Base库的关系依赖</a>
</li>
<li>
<a href="#toc_5">1.4 文档组件环境初始化（该步骤最好初始化完成后立即执行）</a>
</li>
<li>
<a href="#toc_6">1.5 将文档组件添加到需要展示的位置</a>
</li>
<li>
<a href="#toc_7">1.6 启动文档内容（文档、画笔）加载</a>
</li>
<li>
<a href="#toc_8">1.7 文档资源释放（当退出课堂时执行）</a>
</li>
</ul>
</li>
<li>
<a href="#toc_9"><font color=#0099ff size=5 face="黑体">二、文档进阶功能接口说明</font></a>
<ul>
<li>
<a href="#toc_10">2.1 修改文档组件尺寸</a>
</li>
<li>
<a href="#toc_11">2.2 添加组件相关监听事件</a>
</li>
<li>
<a href="#toc_12">2.3 移除文档监听事件</a>
</li>
<li>
<a href="#toc_13">2.4 设置日志开关</a>
</li>
<li>
<a href="#toc_14">2.5 画笔权限管理</a>
</li>
<li>
<a href="#toc_15">2.6 设置画笔的粗细（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</a>
</li>
<li>
<a href="#toc_16">2.7 设置画笔的颜色（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</a>
</li>
<li>
<a href="#toc_17">2.8 撤销画笔（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</a>
</li>
<li>
<a href="#toc_18">2.9 清空画笔数据（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</a>
</li>
<li>
<a href="#toc_19">2.10 橡皮擦功能</a>
</li>
<li>
<a href="#toc_20">2.11 手势支持功能</a>
</li>
<li>
<a href="#toc_21">2.12 设为讲师/取消设为讲师</a>
</li>
<li>
<a href="#toc_22">2.13 授权标注/取消授权标注</a>
</li>
<li>
<a href="#toc_23">2.14 设置文档背景色</a>
</li>
</ul>
</li>
<li>
<a href="#toc_24"><font color=#0099ff size=5 face="黑体">三、文档辅助功能接口说明</font></a>
<ul>
<li>
<a href="#toc_25">3.1 文档加载状态监听</a>
</li>
<li>
<a href="#toc_26">3.2 插播音视频功能相关</a>
</li>
</ul>
</li>
<li>
<a href="#toc_27"><font color=#0099ff size=5 face="黑体">四、文档库、文档切换、文档翻页功能相关</font></a>
<ul>
<li>
<a href="#toc_28">4.1 获取房间关联文档</a>
</li>
<li>
<a href="#toc_29">4.2 取消文档关联</a>
</li>
<li>
<a href="#toc_30">4.3 doc切为白板</a>
</li>
<li>
<a href="#toc_31">4.4 doc切换文档</a>
</li>
<li>
<a href="#toc_32">4.5 doc向前翻页</a>
</li>
<li>
<a href="#toc_33">4.6 doc回退翻页</a>
</li>
<li>
<a href="#toc_34">4.7 获取当前文档id</a>
</li>
</ul>
</li>
<li>
<a href="#toc_35"><font color=#0099ff size=5 face="黑体">五、设为讲师、授权相关监听</font></a>
<ul>
<li>
<a href="#toc_36">5.1 添加消息监听</a>
</li>
<li>
<a href="#toc_37">5.2 监听事件处理</a>
</li>
</ul>
</li>
<li>
<a href="#toc_38"><font color=#0099ff size=5 face="黑体">六、其它</font></a>
<ul>
<li>
<a href="#toc_39">6.1 基础功能集成步骤预览图</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>


<h1 id="toc_0"><font color=#0099ff size=6 face="黑体">白板与文档组件</font></h1>

<p>该组件主要用来同步展示课堂内的PPT、白板、画笔相关信息；</p>

<h2 id="toc_1"><font color=#0099ff size=5 face="黑体">一、文档组件基础功能使用流程</font></h2>

<p>该部分主要实现了该学员可以同步查看课堂内老师、学员对文档的相关操作；如果需要更高级功能请参考其它相关功能API进行实现；</p>

<h3 id="toc_2">1.1 Base库对象的创建</h3>

<pre><code class="language-objc">//1、base库对象头文件引用
#import &lt;CCClassRoomBasic/CCClassRoomBasic.h&gt;

//2、base库对象属性添加
@property(nonatomic,strong)CCStreamerBasic *stremer;

//3、base库对象属性添加
self.stremer = [CCStreamerBasic sharedStreamer];
</code></pre>

<h3 id="toc_3">1.2 文档组件初始化、设置事件监听</h3>

<p>白板与文档组件的核心类是CCDocViewManager;</p>

<pre><code class="language-objc">//在工程需要的地方引入头文件（也可以写一个组件类单独管理）
#import &lt;CCDocLibrary/CCDocLibrary.h&gt;

//1、文档组件初始化
- (CCDocVideoView *)ccVideoView
{
    if (!_ccVideoView) {
        CGRect frame = CGRectMake(0, 0, 200, 100);
        _ccVideoView = [[CCDocVideoView alloc]initWithFrame:frame];
        //2、文档组件添加监听
        [_ccVideoView addObserverNotify];
    }
    return _ccVideoView;
}
</code></pre>

<h3 id="toc_4">1.3 建立文档库与Base库的关系依赖</h3>

<pre><code class="language-objc">    //建立文档库与Base库关联
    - (void)addBasicClient:(CCStreamerBasic *)basic;

    //示例：
     [self.ccVideoView addBasicClient:self.stremer];
</code></pre>

<h3 id="toc_5">1.4 文档组件环境初始化（该步骤最好初始化完成后立即执行）</h3>

<pre><code class="language-objc">     //文档组件初始化，建议先于startDocView一段时间调用
    [self.docView initDocEnvironment];
</code></pre>

<h3 id="toc_6">1.5 将文档组件添加到需要展示的位置</h3>

<pre><code class="language-objc">    //该处以一个控制器的view为例
    [self.view addSubview:self.ccVideoView];
</code></pre>

<h3 id="toc_7">1.6 启动文档内容（文档、画笔）加载</h3>

<pre><code class="language-objc">   [self.docView startDocView];
</code></pre>

<h3 id="toc_8">1.7 文档资源释放（当退出课堂时执行）</h3>

<pre><code class="language-objc">     //1、移除监听
    [self.docView removeObserverNotify];
    if (self.docView)
    {   //2、释放内部资源
        [self.docView docRelease];
    }
    //3、释放文档实例对象
    _docView = nil;
</code></pre>

<h2 id="toc_9"><font color=#0099ff size=5 face="黑体">二、文档进阶功能接口说明</font></h2>

<p>该部分是基于上面第一部分功能做进阶功能的说明；</p>

<h3 id="toc_10">2.1 修改文档组件尺寸</h3>

<pre><code class="language-objc">/** 设置frame */
- (void)setDocFrame:(CGRect)frame;
</code></pre>

<h3 id="toc_11">2.2 添加组件相关监听事件</h3>

<pre><code class="language-objc">//添加监听
- (void)addObserverNotify;
</code></pre>

<h3 id="toc_12">2.3 移除文档监听事件</h3>

<pre><code class="language-objc">//移除监听
- (void)removeObserverNotify;
</code></pre>

<h3 id="toc_13">2.4 设置日志开关</h3>

<pre><code class="language-objc">//设置日志开关
+ (void)setLogState:(BOOL)open;
</code></pre>

<h3 id="toc_14">2.5 画笔权限管理</h3>

<pre><code class="language-objc">- (void)setDocEditable:(BOOL)canEdit;
</code></pre>

<p>object 参数说明：</p>

<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>

<tbody>
<tr>
<td>canEdit</td>
<td>BOOL</td>
<td>YES：支持画笔；NO：不支持画笔</td>
<td>必选</td>
</tr>
</tbody>
</table>

<h3 id="toc_15">2.6 设置画笔的粗细（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</h3>

<pre><code class="language-objc">/** 设置画笔宽度 */
- (void)setStrokeWidth:(CGFloat)width;
</code></pre>

<p>object 参数说明：</p>

<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>

<tbody>
<tr>
<td>width</td>
<td>CGFloat</td>
<td>设置画笔的粗细，精度为CGFloat类型</td>
<td>必选</td>
</tr>
</tbody>
</table>

<h3 id="toc_16">2.7 设置画笔的颜色（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</h3>

<pre><code class="language-objc">/** 设置画笔颜色 */
- (void)setStrokeColor:(UIColor *)color;
</code></pre>

<p>object 参数说明：</p>

<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>

<tbody>
<tr>
<td>color</td>
<td>UIColor</td>
<td>画笔的颜色</td>
<td>必选</td>
</tr>
</tbody>
</table>

<h3 id="toc_17">2.8 撤销画笔（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</h3>

<pre><code class="language-objc">/** 撤销画笔(可以撤销所有人) */
- (void)revokeLastDraw;
/** 撤销（只能撤销学生） */
- (void)revokeLastDrawByStudent;
</code></pre>

<h3 id="toc_18">2.9 清空画笔数据（支持老师端，或是被设为讲师，或是授权标注，才需要设置）</h3>

<p>1、清空当前页的画笔数据：</p>

<pre><code class="language-objc">/** 清除当前页的画笔数据 */
- (void)revokeAllDraw;
</code></pre>

<p>2、清空整个文档的画笔数据</p>

<pre><code class="language-objc">/** 清空整个文档的画笔数据 */
- (void)revokeAllDocDraw;
</code></pre>

<h3 id="toc_19">2.10 橡皮擦功能</h3>

<p>1、是否开启橡皮擦功能：</p>

<pre><code class="language-objc">/** 设置当前是否是橡皮擦 */
- (void)setCurrentIsEraser:(BOOL)eraser;
</code></pre>

<p>object 参数说明：</p>

<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>

<tbody>
<tr>
<td>eraser</td>
<td>BOOL</td>
<td>是否开启橡皮擦</td>
<td>必选</td>
</tr>
</tbody>
</table>

<h3 id="toc_20">2.11 手势支持功能</h3>

<p>1、是否打开文档手势支持：</p>

<pre><code class="language-objc">/** 设置手势开关 */
- (void)setGestureOpen:(BOOL)open;
</code></pre>

<p>如果关闭手势支持，文档会恢复缩放前的状态；</p>

<p>object 参数说明：</p>

<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>

<tbody>
<tr>
<td>open</td>
<td>BOOL</td>
<td>是否开启文档手势</td>
<td>必选</td>
</tr>
</tbody>
</table>

<h3 id="toc_21">2.12 设为讲师/取消设为讲师</h3>

<p>1、设为讲师</p>

<pre><code class="language-objc">/** 设为讲师 */
- (BOOL)authUserAsTeacher:(NSString *)userId;
</code></pre>

<table>
<thead>
<tr>
<th>参数</th>
<th>参数说明</th>
</tr>
</thead>

<tbody>
<tr>
<td>userId</td>
<td>指定的用户id</td>
</tr>
</tbody>
</table>

<p>2、取消设为讲师</p>

<pre><code class="language-objc">/** 取消设为讲师 */
- (BOOL)cancleAuthUserAsTeacher:(NSString *)userId;
</code></pre>

<table>
<thead>
<tr>
<th>参数</th>
<th>参数说明</th>
</tr>
</thead>

<tbody>
<tr>
<td>userId</td>
<td>指定的用户id</td>
</tr>
</tbody>
</table>

<h3 id="toc_22">2.13 授权标注/取消授权标注</h3>

<p>1、授权标注</p>

<pre><code class="language-objc">/** 授权标注 */
- (BOOL)authUserDraw:(NSString *)userId;
</code></pre>

<table>
<thead>
<tr>
<th>参数</th>
<th>参数说明</th>
</tr>
</thead>

<tbody>
<tr>
<td>userId</td>
<td>指定的用户id</td>
</tr>
</tbody>
</table>

<p>2、取消授权标注</p>

<pre><code class="language-objc">/** 取消授权标注 */
- (BOOL)cancleAuthUserDraw:(NSString *)userId;
</code></pre>

<table>
<thead>
<tr>
<th>参数</th>
<th>参数说明</th>
</tr>
</thead>

<tbody>
<tr>
<td>userId</td>
<td>指定的用户id</td>
</tr>
</tbody>
</table>

<h3 id="toc_23">2.14 设置文档背景色</h3>

<pre><code class="language-objc">/** 设置文档区域背景色 */
- (void)setDocBackGroundColor:(UIColor *)color;
</code></pre>

<h2 id="toc_24"><font color=#0099ff size=5 face="黑体">三、文档辅助功能接口说明</font></h2>

<h3 id="toc_25">3.1 文档加载状态监听</h3>

<p>1、文档加载监听</p>

<pre><code class="language-objc">/** 文档加载状态监听 */
- (void)setOnDpCompleteListener:(CCDocLoadBlock)OnDpCompleteListener;
</code></pre>

<h3 id="toc_26">3.2 插播音视频功能相关</h3>

<p>1、设置player容器</p>

<pre><code class="language-objc">//设置 player frame
- (void)setVideoPlayerFrame:(CGRect)playerFrame;
</code></pre>

<p>2、修改player位置大小</p>

<pre><code class="language-objc">//设置 player 容器
- (BOOL)setVideoPlayerContainer:(UIView *)playerContainer;
</code></pre>

<h2 id="toc_27"><font color=#0099ff size=5 face="黑体">四、文档库、文档切换、文档翻页功能相关</font></h2>

<p>该部分主要说明获取房间内的关联文档、文档切换、文档翻页相关功能；</p>

<h3 id="toc_28">4.1 获取房间关联文档</h3>

<p>1、获取房间关联文档</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 获取房间机构文档
 @param roomID 房间ID(缺省为当前登录的房间ID)
 @param userID 房间ID(缺省为当前登录的房间userID)
 @param docID  文档ID（可选）
 @param docName 文档名字(可选)
 @param page    请求页码（获取指定页，默认返回第一页&lt;可选&gt;）
 @param size    请求每页条目数（每页的数据条数，默认每页50&lt;可选&gt;）
 @param completion 回调
 @return 操作结果
 */
- (BOOL)getRelatedRoomDocs:(NSString *)roomID
                    userID:(NSString *)userID
                     docID:(NSString *)docID
                   docName:(NSString *)docName
                pageNumber:(int)page
                  pageSize:(int)size
                completion:(CCComletionBlock)completion;
</code></pre>

<h3 id="toc_29">4.2 取消文档关联</h3>

<p>1、取消房间文档关联</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 删除机构文档
 @param docID 文档ID
 @param roomID 房间ID(缺省为当前登录的房间ID)
 @param userID 房间ID(缺省为当前登录的房间userID)
 @param completion 回调
 @return 操作结果
 */
- (BOOL)unReleatedDoc:(NSString *)docID roomID:(NSString *)roomID userID:(NSString *)userID completion:(CCComletionBlock)completion;
</code></pre>

<h3 id="toc_30">4.3 doc切为白板</h3>

<pre><code class="language-objc">/** 切换到白板 */
- (void)docPageToWhiteBoard;
</code></pre>

<h3 id="toc_31">4.4 doc切换文档</h3>

<pre><code class="language-objc">/** 切换到另一个文档 */
- (void)docChangeTo:(CCDoc *)doc;
</code></pre>

<h3 id="toc_32">4.5 doc向前翻页</h3>

<pre><code class="language-objc">/** 向前翻页 */
- (void)docPageToFront;
</code></pre>

<h3 id="toc_33">4.6 doc回退翻页</h3>

<pre><code class="language-objc">/** 回退翻页 */
- (void)docPageToBack;
</code></pre>

<h3 id="toc_34">4.7 获取当前文档id</h3>

<p>如果是白板则返回『』</p>

<pre><code class="language-objc">/** 获取当前文档 */
- (NSString *)docCurrentDocId;
</code></pre>

<h2 id="toc_35"><font color=#0099ff size=5 face="黑体">五、设为讲师、授权相关监听</font></h2>

<h3 id="toc_36">5.1 添加消息监听</h3>

<p>在需要画板的相关控制器内根据需求添加与移除监听事件</p>

<pre><code class="language-objc">#pragma mark -- 接收
-(void)addObserver
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSocketEvent:) name:CCNotiReceiveSocketEvent object:nil];
}
-(void)removeObserver
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

</code></pre>

<h3 id="toc_37">5.2 监听事件处理</h3>

<p>收到监听事件后根据业务需求进行其它相关操作</p>

<pre><code class="language-objc">
- (void)receiveSocketEvent:(NSNotification *)noti
{
    CCSocketEvent event = (CCSocketEvent)[noti.userInfo[@&quot;event&quot;] integerValue];
    id value = noti.userInfo[@&quot;value&quot;];
   
if (event == CCSocketEvent_ReciveDrawStateChanged)
    {
               //授权标注事件
         CCUser *user = noti.userInfo[@&quot;user&quot;];
        if (user.user_drawState)
        {
            //被授权标注..客户开展后续自己的业务
        }
    }
    else if (event == CCSocketEvent_ReciveAnssistantChange)
    {
        //设为讲师事件
        CCUser *user = noti.userInfo[@&quot;user&quot;];
        if (user.user_AssistantState)
        {
            //被设为讲师..客户开展后续自己的业务
        }
    }
}
</code></pre>

<h2 id="toc_38"><font color=#0099ff size=5 face="黑体">六、其它</font></h2>

<h3 id="toc_39">6.1 基础功能集成步骤预览图</h3>

<p><img src="" alt=""/></p>

<br><br><br><br>

</div></body>

</html>
